package com.zhang.configclient;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *  http://localhost:8770/actuator
     {
         _links: {
         self: {
             href: "http://localhost:8770/actuator",
             templated: false
         },
         bus-refresh: {
             href: "http://localhost:8770/actuator/bus-refresh",
             templated: false
         },
         bus-refresh-destination: {
             href: "http://localhost:8770/actuator/bus-refresh/{destination}",
             templated: true
         }
         }
     }

 POST请求刷新
 http://localhost:8770/actuator/bus-refresh
 *
 *  http://localhost:8770/hello
 * @author zhanghaidong
 */
@RefreshScope
@RestController
@EnableEurekaClient
@SpringBootApplication
public class ConfigClientApplication {

    public static void main(String[] args) {
        SpringApplication.run(ConfigClientApplication.class, args);
    }

    @Value("${my.name}")
    private String name;

    @RequestMapping("/hello")
    public String hello(){
        return name;
    }

}
